//
//  C_addWLCell_1.m
//  Estate
//
//  Created by heyong on 16/6/12.
//  Copyright © 2016年 ttsx. All rights reserved.
//

#import "C_addWLCell_1.h"

@implementation C_addWLCell_1

- (void)setIsEdit:(BOOL)isEdit{
    
    self.text1.userInteractionEnabled=isEdit;
    self.text2.userInteractionEnabled=isEdit;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    self.text1.font=[UIFont systemFontOfSize:16*BIZ];
    self.text2.font=[UIFont systemFontOfSize:16*BIZ];
    self.title1.font=[UIFont systemFontOfSize:16*BIZ];
    self.text2.font=[UIFont systemFontOfSize:16*BIZ];
    self.title1.textColor= UIColorFromRGB(0x797979);
    self.title2.textColor= UIColorFromRGB(0x797979);
    self.selectionStyle=UITableViewCellSelectionStyleNone;
    self.text1.delegate=self;
    self.text2.delegate=self;
    
    self.view1.backgroundColor=[UIColor colorWithRed:0.89 green:0.89 blue:0.90 alpha:1.00];
    
}
//设置分割线
- (void)drawRect:(CGRect)rect
{
    CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor); CGContextFillRect(context, rect);
    //上分割线，
//    CGContextSetStrokeColorWithColor(context, [UIColor grayColor].CGColor); CGContextStrokeRect(context, CGRectMake(0, -1, rect.size.width , 1));
    //下分割线
    CGContextSetStrokeColorWithColor(context,[UIColor colorWithRed:0.89 green:0.89 blue:0.90 alpha:1.00].CGColor); CGContextStrokeRect(context, CGRectMake(0, rect.size.height, rect.size.width, 1));
}

- (void)setValues:(NSString *)value1 AndValuer2:(NSString*)value2{
    self.text1.text=value1;
    self.text2.text=value2;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)text1Change:(UITextField *)sender {
    if(self.text1ValueChangedBlock){
        self.text1ValueChangedBlock(sender.text);
    }
    
}

- (IBAction)text1begin:(UITextField *)sender {
    
}

- (IBAction)text1end:(UITextField *)sender {
    
}

- (IBAction)text2change:(UITextField *)sender {
    if(self.text2ValueChangedBlock){
        self.text2ValueChangedBlock(sender.text);
    }
    
}

- (IBAction)text2begin:(UITextField *)sender {
    
}

- (IBAction)text2end:(UITextField *)sender {
    
}

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    //   限制苹果系统输入法  禁止输入表情
    if ([[[UITextInputMode currentInputMode]primaryLanguage] isEqualToString:@"emoji"]) {
        return NO;
    }
 
    return YES;
    
}
@end
